home *** CD-ROM | disk | FTP | other *** search
- on toggleHorsepower desiredSetting
- global gHorsepower, oStoryteller
- if getPos([#low, #high], desiredSetting) = 0 then
- put "<!> Sorry, " & desiredSetting & " is not a valid suggestion for gHorsepower"
- exit
- end if
- set gHorsepower to desiredSetting
- setState(oStoryteller, #horsePower, desiredSetting)
- grabberInit()
- end
-
- on patchPalette
- global oFixPal
- if objectp(oFixPal) then
- oFixPal(mPatchIt)
- end if
- end
-
- on forcePalette palName
- global oPuppeteer, gCurrentPalette
- puppetPalette(palName, 60)
- set gCurrentPalette to #changeMe
- patchPalette()
- end
-
- on loadMultiframes whichOnes
- global oPuppeteer
- set theFrames to getaProp(the lsMultiframes of oPuppeteer, whichOnes)
- if listp(theFrames) then
- repeat with i in theFrames
- preLoadCast(i)
- end repeat
- else
- alert("Hey! There's no such list in lsMultiframes!")
- end if
- end
-
- on purgeMultiframes whichOnes
- global oPuppeteer
- set theFrames to getaProp(the lsMultiframes of oPuppeteer, whichOnes)
- if listp(theFrames) then
- repeat with i in theFrames
- unLoadCast(i)
- end repeat
- else
- alert("Hey! There's no such list in lsMultiframes!")
- end if
- end
-
- on gammaFade upOrDown, howFast, optionSwitch
- global gCPU, gFadeStash, oPuppeteer, domainIsReady, oStoryteller, gVidViz
- if gCPU = #PC then
- if upOrDown = #down then
- set domainIsReady to 0
- set gFadeStash to []
- repeat with i = 1 to 48
- append(gFadeStash, the loc of sprite i)
- if getPos([44, 45, 47, 48], i) = 0 then
- set the loc of sprite i to point(-1000, -1000)
- end if
- if (i = 44) or (i = 45) then
- setAt(gFadeStash, i, the visible of sprite i)
- set the visible of sprite i to 0
- end if
- end repeat
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #fadeIn))
- updateStage()
- end if
- if upOrDown = #up then
- set movieSprite to 45
- if listp(gFadeStash) then
- repeat with i = 1 to 48
- if getPos([44, 45, 47, 48], i) = 0 then
- set the loc of sprite i to getAt(gFadeStash, i)
- end if
- end repeat
- end if
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #fadeIn))
- if getState(oStoryteller, #currentLocation) = #garageEscape then
- set the loc of sprite 44 to point(-1000, -1000)
- end if
- set creditsLoc to the loc of sprite 45
- set the loc of sprite 45 to point(-1000, -1000)
- updateStage()
- set the loc of sprite 45 to creditsLoc
- if listp(gFadeStash) then
- if optionSwitch <> #resumeGame then
- repeat with vNum in [44, 45]
- set the visible of sprite vNum to getAt(gFadeStash, vNum)
- end repeat
- else
- set the visible of sprite 44 to getAt(gVidViz, 1)
- set the visible of sprite 45 to getAt(gVidViz, 2)
- set the movieTime of sprite 45 to getAt(gVidViz, 3)
- end if
- if the keyDownScript = EMPTY then
- set domainIsReady to 1
- end if
- end if
- end if
- if upOrDown = #clearStage then
- set gFadeStash to #None
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #fadeIn))
- updateStage()
- end if
- else
- set speedCodes to [#glacial: "4", #slow: "18", #fast: "36", #instant: "100"]
- set mySpeed to getaProp(speedCodes, howFast)
- if voidp(mySpeed) then
- set mySpeed to getProp(speedCodes, #fast)
- end if
- if upOrDown = #down then
- MonitorFade("down", mySpeed)
- else
- updateStage()
- MonitorFade("up", mySpeed)
- end if
- end if
- end
-
- on fadeTest
- gammaFade(#down)
- wait(15)
- gammaFade(#up, #glacial)
- end
-
- on setColor howManybits
- set the colorDepth to howManybits
- if the colorDepth <> howManybits then
- put "Sorry, Director sez the colorDepth is " & the colorDepth & " bits.."
- else
- put "OK, we did it.."
- end if
- end
-
- on peekAlert
- global oStoryteller, oPuppeteer, gPeekAlertEnabled
- if (gPeekAlertEnabled = 0) or (getState(oStoryteller, #playerHasPeekUnit) = 0) then
- exit
- end if
- set colorGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 1)
- set highGlowGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 3)
- set lowGlowGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 2)
- set oldPeekGraphic to the castNum of sprite 7
- if oldPeekGraphic = colorGraphic then
- set lowGlowGraphic to colorGraphic
- end if
- set bigGlow to 1
- repeat with i = 1 to 12
- set startTix to the ticks
- repeat while the ticks < (startTix + 5)
- updateStage()
- end repeat
- if bigGlow = 1 then
- set the castNum of sprite 7 to highGlowGraphic
- else
- set the castNum of sprite 7 to lowGlowGraphic
- end if
- updateStage()
- set bigGlow to not bigGlow
- end repeat
- set the castNum of sprite 7 to oldPeekGraphic
- updateStage()
- end
-
- on setScanTime howManyMinutes
- global gScanFinish
- set gScanFinish to the ticks + (howManyMinutes * 3600)
- setState(oStoryteller, #PeekDisplay, value("#goodScan" & howManyMinutes & "min"))
- setState(oStoryteller, #PKscanStatus, value("#Wait" & howManyMinutes & "min"))
- peekAlert()
- end
-
- on pyramidSpeaks
- global oPuppeteer, oStoryteller
- cursorOff()
- set remainingMessages to getProp(the lsStateData of oStoryteller, #pyramidMessagesRemaining)
- set messagesStack to getProp(the lsMultiframes of oPuppeteer, #PyramidMsg)
- if count(remainingMessages) > 0 then
- set helpTest to getAt(remainingMessages, 1)
- if helpTest = #helpMe then
- set myAnswer to 6
- deleteAt(remainingMessages, 1)
- else
- set msgPosition to random(count(remainingMessages))
- set myAnswer to getAt(remainingMessages, msgPosition)
- deleteAt(remainingMessages, msgPosition)
- if count(remainingMessages) = 0 then
- append(remainingMessages, #helpMe)
- end if
- end if
- else
- set myAnswer to random(5)
- if myAnswer = 5 then
- if random(3) = 3 then
- set myAnswer to 6
- end if
- end if
- end if
- set msgSprite to #None
- repeat with i = 10 to 48
- if getPos(messagesStack, the castNum of sprite i) then
- set msgSprite to i
- exit repeat
- end if
- end repeat
- if msgSprite = #None then
- alert("pyramidSpeaks: Yikes.. Couldn't find the message-sprite")
- exit
- end if
- set the castNum of sprite msgSprite to getAt(messagesStack, myAnswer + 1)
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #fadeIn))
- soundEffect(#pyramidGurgle)
- wait(25)
- updateStage()
- end
-
- on togglePreloading
- global gPreloading
- set gPreloading to not gPreloading
- unLoadCast()
- if gPreloading then
- else
- end if
- end
-
- on toggleTransitions qualityDesired
- global gStopTransitions, oPuppeteer, gTransQuality
- set gTransQuality to qualityDesired
- if qualityDesired = #None then
- set gStopTransitions to 1
- else
- set gStopTransitions to 0
- end if
- if qualityDesired = #Better then
- setProp(the lsMachineProfile of oPuppeteer, #transitions, [#turnRight: "02,1,16,TRUE", #turnLeft: "01,1,16,TRUE", #forward: "09,1,8,TRUE", #lookAt: "09,1,8,TRUE", #backOff: "10,1,8,TRUE", #lookUp: "03,1,16,TRUE", #lookDown: "04,1,16,TRUE", #fadeIn: "50,2,8,TRUE", #slowMontage: "50,3,8,TRUE", #nextPage: "2,2,32,TRUE", #prevPage: "1,2,32,TRUE"])
- end if
- if qualityDesired = #Best then
- setProp(the lsMachineProfile of oPuppeteer, #transitions, [#turnRight: "02,1,16,TRUE", #turnLeft: "01,1,16,TRUE", #forward: "26,2,0,TRUE", #lookAt: "26,2,0,TRUE", #backOff: "26,2,0,TRUE", #lookUp: "03,1,16,TRUE", #lookDown: "04,1,16,TRUE", #fadeIn: "26,2,0,TRUE", #slowMontage: "26,3,0,TRUE", #nextPage: "2,2,16,TRUE", #prevPage: "1,2,16,TRUE"])
- end if
- end
-
- on toggleBitDepth
- global g16bit
- if g16bit then
- set the colorDepth to 8
- if the colorDepth = 8 then
- set g16bit to 0
- else
- alert("Couldn't set the colordepth to 8-bit.. (Check the Monitors control panel for this monitor)")
- end if
- else
- set the colorDepth to 16
- if the colorDepth = 16 then
- set g16bit to 1
- else
- alert("Couldn't set the colordepth to 16-bit.. (Check the Monitors control panel for this monitor)")
- end if
- end if
- if g16bit then
- else
- end if
- end
-
- on selectiveUpdate castList
- global oPuppeteer, oStoryteller
- set castUpdates to []
- set spotUpdates to []
- set match to #None
- repeat with testString in castList
- repeat with candidate in the lsOnstage of oPuppeteer
- if getProp(candidate, #castName) = testString then
- set match to candidate
- put RETURN & "match = " & match
- exit repeat
- end if
- end repeat
- if match <> #None then
- append(lsUpdates, match)
- set match to #None
- next repeat
- end if
- repeat with candidate in the lsAllHotspots of oPuppeteer
- if getAt(getAt(candidate, 3), 1) = testString then
- set match to candidate
- put RETURN & "match = " & match
- exit repeat
- end if
- end repeat
- if match = #None then
- alert("No match for string: '" & testString & "'")
- next repeat
- end if
- append(lsUpdates, match)
- set match to #None
- end repeat
- put RETURN & ">> FINAL LIST <<"
- put castUpdates
- end
-
- on changePal startCast, finishCast, newPalette
- set newPaletteNumber to the number of member newPalette
- repeat with i = startCast to finishCast
- if the castType of cast i = #bitmap then
- set the palette of cast i to newPaletteNumber
- next repeat
- end if
- put the name of cast i & " is not a #bitmap castmember."
- end repeat
- end
-
- on grabberInit
- global oGrabber, gRippleSize, gCPU, gHorsepower
- set totalRAM to the memorysize / 1024
- if (totalRAM >= 8000) and (gHorsepower <> #low) then
- preLoadCast(2428, 2451)
- set gRippleSize to #large
- else
- if totalRAM >= 6000 then
- preLoadCast(2453, 2472)
- set gRippleSize to #small
- else
- return #lowRAM
- exit
- end if
- end if
- return #OK
- end
-
- on ripple
- global oGrabber, gLastRipple, gRippleSize, gOriginPoint
- if the ticks < (gLastRipple + (3 * 60)) then
- exit
- end if
- if voidp(gRippleSize) then
- set rippleStatus to grabberInit()
- put "rippleStatus = " & rippleStatus
- if rippleStatus <> #OK then
- exit
- end if
- end if
- set rippleSprite to 37
- puppetSprite(rippleSprite, 1)
- set the ink of sprite rippleSprite to 9
- if gRippleSize = #small then
- set firstCastPos to 2453
- set lastCastPos to 2471
- set grabWidth to 96
- set grabHeight to 96
- set rippleTempo to 2
- else
- set firstCastPos to 2428
- set lastCastPos to 2450
- set grabWidth to 160
- set grabHeight to 170
- set rippleTempo to 1
- end if
- set clipRegion to rect(the stageLeft + 112, the stageTop + 80, the stageLeft + 534, the stageTop + 356)
- set leftOffset to random(the right of clipRegion - the left of clipRegion - (grabWidth + 2))
- set leftEdge to the left of clipRegion + leftOffset
- set topOffset to random(the bottom of clipRegion - the top of clipRegion - (grabWidth - 2))
- set topEdge to the top of clipRegion + topOffset
- set errCode to ScreenToClipboard(leftEdge, topEdge, leftEdge + grabWidth, topEdge + grabHeight)
- if errCode = "OK" then
- alert("errcode = " & errCode)
- exit
- end if
- set leftEdge to leftEdge - the stageLeft
- set topEdge to topEdge - the stageTop
- set the loc of sprite rippleSprite to point(leftEdge + (grabWidth / 2), topEdge + (grabHeight / 2))
- set the loc of sprite rippleSprite to the loc of sprite rippleSprite + point(1, 1)
- pasteClipBoardInto(member firstCastPos)
- set the castNum of sprite rippleSprite to firstCastPos
- set newPos to firstCastPos + 2
- updateStage()
- repeat while newPos <= lastCastPos
- wait(rippleTempo)
- move(cast (newPos - 2), newPos)
- set the castNum of sprite rippleSprite to newPos
- set newPos to newPos + 2
- updateStage()
- end repeat
- move(cast lastCastPos, firstCastPos)
- set the loc of sprite rippleSprite to point(-1000, -1000) + gOriginPoint
- set gLastRipple to the ticks
- end
-